<?php
/**
 * @package panel
 * @subpackage panel.rrp
**/
/**
 * @author Dmitry Bakaleinik (code)
 */
class panel__rrp__ui
	extends panel__rrp {

	protected $title = "ui";

	public function __route() {

		$R = array(

			"layout" => array(

				"is_default" => TRUE

			),

			"style"           => TRUE,
			"js"              => TRUE,
			"js__environment" => TRUE,
			"error"           => TRUE,
			"index"           => TRUE,
			"phpinfo"         => TRUE,

		);

		return $R;

	}	# Function

	protected function phpinfo( array $_request_, panel__application__response $_response_) {

		$_response_->setType( panel__application__response::TYPE__TEXT__HTML );

		phpinfo();

	}	# Function

	protected function error($_message_) {

		$template = new panel__template;
		$template->setTemplate("ui/pages/error.html");

		$template->assign(
			"error",
			p()->validate($_message_, "scalar!", "~string")
		);

		return $template->fetchTemplate();

	}	# Function

	protected function index( array $_request_ ) {

		$template = new panel__template;
		$template->setTemplate("ui/pages/index.html");

		$template->assign("environment", p()->env()->getEnvironment());

		return $template->fetchTemplate();

	}	# Function

	protected function js() {

		$template = new panel__template;
		$template->setTemplate("ui/js/index.js");

		$template->assign("environment", p()->env()->getEnvironment());

		return $template->fetchTemplate();

	}	# Function

	protected function js__environment() {

		$template = new panel__template;

		$template->setTemplate("ui/js/panel.environment.js");

		$template->assign("environment", p()->env()->getEnvironment());

		return $template->fetchTemplate();

	}	# Function

	protected function layout($_content_) {

		$template = new panel__template;
		$template->setTemplate("ui/layout/layout.html");

		$template->assign("environment", p()->env()->getEnvironment());
		$template->assign("content", $_content_);

		return $template->fetchTemplate();

	}	# Function

	protected function style() {

		$template = new panel__template;
		$template->setTemplate("ui/css/index.css");

		$template->assign("path_web", PANEL__PATH__WEB );

		return $template->fetchTemplate();

	}	# Function

}	# Class

/* EOF */